import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '表名',
    align:"center",
    dataIndex: 'tableName',
    fixed: 'left',
    width: 230,
   },
   {
    title: '列名',
    align:"center",
    dataIndex: 'columnName',
    fixed: 'left',
    width: 230,
   },
   {
    title: '列名(中文)',
    align:"center",
    dataIndex: 'columnComment'
   },
   {
    title: '数据类型',
    align:"center",
    dataIndex: 'dataType'
   },
   {
    title: '完整列类型定义',
    align:"center",
    dataIndex: 'columnType'
   },
   {
    title: '数据库目录名',
    align:"center",
    dataIndex: 'tableCatalog'
   },
   {
    title: '数据库名',
    align:"center",
    dataIndex: 'tableSchema'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'ordinalPosition'
   },
   {
    title: '列默认值',
    align:"center",
    dataIndex: 'columnDefault'
   },
   {
    title: '是否允许NULL值',
    align:"center",
    dataIndex: 'isNullable'
   },
   {
    title: '最大长度',
    align:"center",
    dataIndex: 'characterMaximumLength'
   },
   {
    title: '字节长度',
    align:"center",
    dataIndex: 'characterOctetLength'
   },
   {
    title: '精度',
    align:"center",
    dataIndex: 'numericPrecision'
   },
   {
    title: '小数位数',
    align:"center",
    dataIndex: 'numericScale'
   },
   {
    title: '时间精度',
    align:"center",
    dataIndex: 'datetimePrecision'
   },
   {
    title: '字符集',
    align:"center",
    dataIndex: 'characterSetName'
   },
   {
    title: '排序规则',
    align:"center",
    dataIndex: 'collationName'
   },
   {
    title: '列索引类型',
    align:"center",
    dataIndex: 'columnKey'
   },
   {
    title: '额外信息',
    align:"center",
    dataIndex: 'extra'
   },
   {
    title: '列权限',
    align:"center",
    dataIndex: 'privileges'
   },
   {
    title: '列表达式',
    align:"center",
    dataIndex: 'generationExpression'
   },
   {
    title: '加密类型',
    align:"center",
    dataIndex: 'encryptionType'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '表名',
    field: 'tableName',
    component: 'Input',
  },
];
//弹出框-表单数据
export const formSchema: FormSchema[] = [
  {
    label: '数据库目录名',
    field: 'tableCatalog',
    component: 'Input',
  },
  {
    label: '数据库名',
    field: 'tableSchema',
    component: 'Input',
  },
  {
    label: '表名',
    field: 'tableName',
    component: 'Input',
  },
  {
    label: '列名',
    field: 'columnName',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'ordinalPosition',
    component: 'InputNumber',
  },
  {
    label: '列默认值',
    field: 'columnDefault',
    component: 'InputTextArea',
  },
  {
    label: '是否允许NULL值',
    field: 'isNullable',
    component: 'Input',
  },
  {
    label: '数据类型',
    field: 'dataType',
    component: 'Input',
  },
  {
    label: '最大长度',
    field: 'characterMaximumLength',
    component: 'Input',
  },
  {
    label: '字节长度',
    field: 'characterOctetLength',
    component: 'Input',
  },
  {
    label: '精度',
    field: 'numericPrecision',
    component: 'Input',
  },
  {
    label: '小数位数',
    field: 'numericScale',
    component: 'Input',
  },
  {
    label: '时间精度',
    field: 'datetimePrecision',
    component: 'Input',
  },
  {
    label: '字符集',
    field: 'characterSetName',
    component: 'Input',
  },
  {
    label: '排序规则',
    field: 'collationName',
    component: 'Input',
  },
  {
    label: '完整列类型定义',
    field: 'columnType',
    component: 'InputTextArea',
  },
  {
    label: '列索引类型',
    field: 'columnKey',
    component: 'Input',
  },
  {
    label: '额外信息',
    field: 'extra',
    component: 'Input',
  },
  {
    label: '列权限',
    field: 'privileges',
    component: 'Input',
  },
  {
    label: '列名(中文)',
    field: 'columnComment',
    component: 'Input',
  },
  {
    label: '列表达式',
    field: 'generationExpression',
    component: 'Input',
  },
  {
    label: '加密类型',
    field: 'encryptionType',
    component: 'Input',
  },
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}